package com.hoperun.framework.jdbc.dialect;

public class MybatisH2Dialect extends Dialect {
	public boolean supportsLimit() {
		return true;
	}

	public String getLimitString(String sql, int offset,
			String offsetPlaceholder, int limit, String limitPlaceholder) {
		int temp = 40;
		StringBuffer sb = new StringBuffer(sql.length() + 40);
		sb.append(sql);
		if (offset > 0) {
			sb.append(" limit ").append(limitPlaceholder).append(" offset ")
					.append(offsetPlaceholder);
		} else {
			sb.append(" limit ").append(limitPlaceholder);
		}
		return sb.toString();
	}

	public boolean supportsLimitOffset() {
		return true;
	}
}